<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/3/27
 * Time: 下午4:13
 */

header("content-type:text/html;charset=utf-8");

$script = "以下内容不显示：<script type='text/javascript'>alert('c');</script>";
$pattern = '/<script[^>]*?>.*?</script>/';


$pattern = '/<("[^"]*"|\'[^\']\*\'|[^>"\'])*>/';

echo strip_tags($script,'<script>');
echo strip_tags($script);

function strip_html_tags($str){
  $pattern = '/<("[^"]*"|\'[^\']\*\'|[^>"\'])*>/';
  return preg_replace($pattern,'',$str);
}

echo PHP_EOL;
echo strip_html_tags($script);

echo PHP_EOL;
echo preg_match('/^[\w\-\.]+@[\w\-]+(\.\w+)+$/',"599490911@qq.com");
echo preg_match('/^[\w\-\.]+@[\w\-]+(\.\w+)+$/',"599490911@qq.com");